#ifndef __EEPROM_H
#define __EEPROM_H	 
#include "sys.h"

#define  PARA_VER_CFG_SIZE   (sizeof(gPara_Ver_Config))
#define  SYS_CFG_SIZE      (sizeof(gSys_Config ))
#define  CHARGE_CFG_SIZE   (sizeof(gCharge_Config ))
#define  OUVOIT_CFG_SIZE   (sizeof(gOUvolt_Config ))
#define  OUCURR_CFG_SIZE   (sizeof(gOUcurr_Config ))
#define  OUTEMP_CFG_SIZE   (sizeof(gOUtemp_Config ))
#define  OULINE_CFG_SIZE  (sizeof(gOUline_Volt_Config))
#define  OTHER_CFG_SIZE    (sizeof(gOther_Config ))
#define  CSPARA_CFG_SIZE   (sizeof(gCSPara_Config))

#define  EEP_PARA_ADDR       EEP_CONFIG_ADDR
#define  EEP_SYS_ADDR        EEP_PARA_ADDR+PARA_VER_CFG_SIZE
#define  EEP_CHARGE_ADDR     EEP_SYS_ADDR+SYS_CFG_SIZE
#define  EEP_OUVOLT_ADDR     EEP_CHARGE_ADDR+CHARGE_CFG_SIZE
#define  EEP_OUCURR_ADDR     EEP_OUVOLT_ADDR+OUVOIT_CFG_SIZE
#define  EEP_OUTEMP_ADDR     EEP_OUCURR_ADDR+OUCURR_CFG_SIZE
#define  EEP_OULINE_ADDR    EEP_OUTEMP_ADDR+OUTEMP_CFG_SIZE
#define  EEP_OTHER_ADDR      EEP_OULINE_ADDR+OULINE_CFG_SIZE
#define  EEP_CSPARA_ADDR     EEP_OTHER_ADDR+OTHER_CFG_SIZE

u8 eeprom_test(void);
u8 eeprom_dataCRC(u8 *crcdata , u16 sizedata);
u8 Para_Ver_Write(u8 *bufdata, u16 sizedata);
u8 Para_Ver_Read(u8 *bufdata , u16 sizedata);
u8 Para_Ver_Export_Param(void);
u8 Sys_Cfg_Write(u8 *bufdata, u16 sizedata);
u8 Sys_Cfg_Read(u8 *bufdata , u16 sizedata);
u8 Sys_Cfg_Export_Param(void);
u8 Charge_Cfg_Write(u8 *bufdata, u16 sizedata);
u8 Charge_Cfg_Read(u8 *bufdata , u16 sizedata);
u8 Charge_Cfg_Export_Param(void);
u8 OUvolt_Cfg_Write(u8 *bufdata, u16 sizedata);
u8 OUvolt_Cfg_Read(u8 *bufdata , u16 sizedata);
u8 OUvolt_Cfg_Export_Param(void);
u8 OUcurr_Cfg_Write(u8 *bufdata, u16 sizedata);
u8 OUcurr_Cfg_Read(u8 *bufdata , u16 sizedata);
u8 OUcurr_Cfg_Export_Param(void);
u8 OUtemp_Cfg_Write(u8 *bufdata, u16 sizedata);
u8 OUtemp_Cfg_Read(u8 *bufdata , u16 sizedata);
u8 OUtemp_Cfg_Export_Param(void);
u8 OUtotal_Cfg_Write(u8 *bufdata, u16 sizedata);
u8 OUtotal_Cfg_Read(u8 *bufdata , u16 sizedata);
u8 OUtotal_Cfg_Export_Param(void);
u8 Other_Cfg_Write(u8 *bufdata, u16 sizedata);
u8 Other_Cfg_Read(u8 *bufdata , u16 sizedata);
u8 Other_Cfg_Export_Param(void);
u8 CSPara_Cfg_Write(u8 *bufdata, u16 sizedata);
u8 CSPara_Cfg_Read(u8 *bufdata, u16 sizedata);
u8 CSPara_Cfg_Export_Param(void);

void Param_Eep_Set_Data(u8 *msgbuf);

#endif




